package com.auth.cloud.gateway.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * 网关自定义配置属性
 *
 * @author auth-cloud
 * @since 2024-01-01
 */
@Data
@Component
@ConfigurationProperties(prefix = "gateway.custom")
public class CustomGatewayProperties {

    /**
     * 白名单路径
     */
    private List<String> whiteList = Arrays.asList(
            "/auth/login",
            "/auth/register",
            "/auth/captcha",
            "/auth/refresh",
            "/user/register",
            "/actuator",
            "/swagger-ui",
            "/v3/api-docs",
            "/webjars"
    );

    /**
     * 超时时间（毫秒）
     */
    private Long timeout = 30000L;

    /**
     * 重试次数
     */
    private Integer retryCount = 3;
}
